
{if $notPopup}
</div>
</div>
</div>
</div>
</div>
{else/}
<!--</div>-->
</div>
</div>
</div>
</div>
{/if}

<script src="{$static_dir}/assets/js/iscroll.js"></script>
<script src="{$static_dir}/assets/js/amazeui.min.js"></script>
<script src="{$static_dir}/assets/js/amazeui.datatables.min.js"></script>

<script src="{$static_dir}/assets/js/dataTables.responsive.min.js"></script>
<script src="{$static_dir}/assets/js/app.js"></script>
<script src="{$static_dir}/assets/js/common.js"></script>
<script src="{$static_dir}/assets/js/usecar.js"></script>
<script src="{$static_dir}/assets/js/pages.js"></script>
<script src="{$static_dir}/assets/js/new_pages.js"></script>
<!-- <script src="{$static_dir}/assets/js/upImage.js"></script> -->
<script>
	layui.use(['layer','laydate','table'], function(){ 
 	 var $ = layui.jquery, layer = layui.layer; 
 	  var laydate = layui.laydate;
	{include file="$JSFILE"}
	//菜单选中
	if($('#map').data('map')){
		var winheight=window.innerHeight-56 
			console.log(winheight)

			$('.tpl-content-wrapper').css('min-height',0)
			$('.tpl-content-wrapper').css('height',winheight)
			$('.scrollmain-w').css('top',0)
			$('.scrollmain-w').css('bottom',0)
			console.log($('.scrollmain-w').css('height'))
			$('#scrollmain').css('height',winheight)
			$('#scrollmain').css('overflow','auto')
			//点击添加图片
		
	}else{
		{if $notPopup}
			var winheight=window.innerHeight-56 
			console.log(winheight)

			$('.tpl-content-wrapper').css('min-height',0)
			$('.tpl-content-wrapper').css('height',winheight)
			$('.scrollmain-w').css('top',0)
			$('.scrollmain-w').css('bottom',0)
			console.log($('.scrollmain-w').css('height'))
			$('#scrollmain').css('height',winheight)
			var myScroll = new IScroll('#scrollmain', {
				mouseWheel: true,
				disableMouse: true,
    			disablePointer: true,
    			scrollbars: 'custom',
    			interactiveScrollbars:true,
			});
			//点击添加图片
			$('input[type="file"]').on('change',function(){
			if($(this).data('type')=='img'){
				var fil=$(this)[0].files[0];
				var that=this;
				var reader = new FileReader();
				reader.onload = function(evt) {
					$(that).closest('.file-w').find('.fileimg').attr('src',evt.target.result)
				}
				reader.readAsDataURL(fil);
			}
		});
		{else/}
		var winheight=window.innerHeight
		$('.scrollmain-w').css('top',0)
		$('.scrollmain-w').css('bottom',0)
		console.log($('.scrollmain-w').css('height'))
		$('#scrollmain').css('height',winheight)
		var myScroll = new IScroll('#scrollmain', {
				mouseWheel: true,
				disableMouse: true,
    			disablePointer: true,
    			scrollbars: 'custom',
    			interactiveScrollbars:true,
			});
		{/if}
	}
	{if $menu_current}
		
		$(".sidebar-nav [data-url^='{$menu_current}']").parents('li:first').find('a:first').addClass('active').parents('ul:not(".topest")').css('display','block').find('.sidebar-nav-sub-ico:first').addClass('sidebar-nav-sub-ico-rotate');
	
	{/if}
	//侧边栏滚动
	{if $notPopup}
	var menumainhi=parseInt($(window).height()-56-190-20)
	$('.menuheight').css('height',menumainhi+'px')
	var myScroll1 = new IScroll('#menuMain', {
		mouseWheel: true
	});
	
	$('.sidebar-nav-link').on('click',function(){
		setTimeout(function () {
	        myScroll1.refresh();
	    }, 100);
	});
	
	{/if}
	$(function(){
		$('.exit').on('click',function(){
			// console.log("{:url('edit')}/driver_id/"+$(this).closest('tr').data('id'))
			exitchang("{:url('edit')}?op=popup&driver_id="+$(this).closest('tr').data('id'))
		})
		//用车日期
		usecar_apply_click("{:url('admin/order/orders')}")
		
		
		$('button').on('click',function(){
		 	if($(this).data('type')=='file'){
		 		$(this).parent().find('input[type=file]').click()
		 	}
		});
		//更新缓存
		$('button[data-cache]').on('click',function(){
			var that=this
			$.ajax({
				type:'post',
				url:"index/cache",
				data:{
					cache:$(that).data('cache')
				},
				success:function(res){
					rslt(res)
				}
			})
		});
		$('.close-input').on('click',function(){
			console.log(1)
			for(var i=0;i<$(this).parent().find('input').length;i++){
				$(this).parent().find('input').eq(i).val('')
			}
			
		});
		$('img').on('click',function(){
			if($(this).data('magnify')){
				console.log($(this).attr('src'))
				layer.open({
				  type: 1,
				  title:false,
				  skin: 'layui-layer-rim', //加上边框
				  area: ['500px', '500px'], //宽高
				  content: `<img style="width: 100%;height:100%;" src="${$(this).attr('src')}" />`
				});
			}
		});
		$("#loading-first").fadeOut(500);
        {if empty($local)}
		setInterval(function(){
			$.ajax({
				type:"post",
				url:"{:url('adminapi/order/hasNew')}",
				success:function(res){
					if(res.data==1){
						prompt()
					}else{
							
					}
					
				}
			});
			
		},5000)
        {/if}
		function prompt(){
			$('.dingmp3')[0].play()
			$('.dingmp3')[0].currentTime = 0;
			$('.dingmp3')[0].play();
			var alarm_hint=layer.open({
			    type: 1,
			    title:false,
			    id: 'neworder',
	       		offset: 'rb',
			    skin: 'layui-layer-rim', //加上边框
			    area: ['300px', '120px'],
			    shade: 0  ,//不显示遮罩//宽高
			    content: `<div class='am-u-sm-12' style="padding:20px">
			  				<div class='am-u-sm-12' style='text-align: center;'>有新订单未处理</div>
			  				<div class='am-u-sm-12' style='text-align: center;'>
			  				<button class="am-btn am-btn-sm am-radius am-btn-primary alarm_dispose">处理</button>
			  				<button class="am-btn am-btn-sm am-radius am-btn-primary prop_close">取消</button>
			  				</div>
			  			</div>`,
			  	success:function(){
			  		$('.alarm_dispose').on('click',function(){
			  			
			  			window.location.href='{:url("/admin/order/index")}?order_state=4'
			  		});
			  		$('.prop_close').on('click',function(){
			  			
			  		})
			  	}
			});
		}
	})
	})
</script>

</body>

</html>